<?php

namespace App\Library\Logic;

use App\Models\AuditModel;

class AuditLogic extends AuditModel
{

    public static function bankError(AuditModel $model, array $arr, mixed $message): void
    {
        self::query()->where('serial_number', $model->serial_number)->update(['status' => 2]);
        $content = is_string($model->content) ? [$model->content] : $model->content;
        self::updateById($model->id, [
            'status' => 2,
            'content' => array_merge($content, ['cl' => $arr, 'msg' => $message]),
        ]);
    }
}
